package com.dz.ejb.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

@Entity
@NamedQueries({
    @NamedQuery(name = "searchUserName", query = "From User u where upper(u.name) LIKE concat('%',:word,'%')"),
    @NamedQuery(name = "searchUserMail", query = "From User u where upper(u.mail) LIKE concat('%',:word,'%')")
    //@NamedQuery(name = "updateUserQuery", query = "UPDATE User u SET u.nom= ?1, u.prenom= ?2, u.mail= ?3, u.birthday= ?4 WHERE u.idUser= ?5") 
})
public class User {
	private int id;
	private String name;
	private String password;
	private String mail;
	
	public User() {}
	
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}
}
